home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / SML⁄NJ 93+ / Documentation / examples / textbooks / four_lectures / build3.sml < prev    next >
Encoding:
Text File  |  1995-12-30  |  1.3 KB  |  54 lines  |  [TEXT/R*ch]

  1. (* build3.sml *)
  2.  
  3.                (* building the system *)
  4.  
  5. structure Expression= Expression();
  6.  
  7. structure Parser= Parser(Expression);
  8.  
  9. structure Value = Value();
  10.  
  11. structure Evaluator= 
  12.    Evaluator(structure Expression= Expression
  13.              structure Value = Value);
  14.  
  15.  
  16. structure AppTy = AppType(); 
  17.  
  18. structure AppUnify = Unify(AppTy);
  19.  
  20. structure AppTyCh= 
  21.   TypeChecker(structure Ex = Expression
  22.               structure Ty = AppTy
  23.               structure Unify= AppUnify);
  24.  
  25. structure AppInter=
  26.   Interpreter(structure Ty= AppTy
  27.               structure Value = Value
  28.               structure Parser = Parser
  29.               structure TyCh = AppTyCh
  30.               structure Evaluator = Evaluator);
  31.  
  32. val (appint,appeval,apptc)=(AppInter.interpret,AppInter.eval,AppInter.tc);
  33.  
  34. structure ImpTy = ImpType(); 
  35.  
  36. structure ImpUnify = Unify(ImpTy);
  37.  
  38. structure ImpTyCh= 
  39.   TypeChecker(structure Ex = Expression
  40.               structure Ty = ImpTy
  41.               structure Unify= ImpUnify);
  42.  
  43. structure ImpInter=
  44.   Interpreter(structure Ty= ImpTy
  45.               structure Value = Value
  46.               structure Parser = Parser
  47.               structure TyCh = ImpTyCh
  48.               structure Evaluator = Evaluator);
  49.  
  50. val (impint,impeval,imptc)=
  51.     (ImpInter.interpret,ImpInter.eval,ImpInter.tc);
  52.  
  53.  
  54.